package cn.smbms.tools;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

import cn.smbms.dao.BaseDao;
import cn.smbms.lan_han_mo_shi.Lan_E_JieHe;
import cn.smbms.lan_han_mo_shi.Lan_E_JieHe.Cys;

public class ConfigMapper {
	private static Properties properties;
	//把构造器设置为私有，防止程序员new出对象
	private ConfigMapper(){}



	/*
	 * 内部静态类：类加载不实例化，需调用。线程安全，延迟加载
	 */
	public static class Cys{
		private static final Properties params=new Properties();

	static {
		InputStream is=BaseDao.class.getClassLoader().getResourceAsStream("database.properties");
		try {
			params.load(is);
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
	} 


	public static  String getProptrtKey(String zhi){
		properties=Cys.params;
		return properties.getProperty(zhi);

	}
}

